package org.example.myleet.p628;

import java.util.Arrays;

public class Solution1 {
    /**
     * 14 ms
     * 对Solution的讨论进行简化
     */
    public int maximumProduct(int[] nums) {
        Arrays.sort(nums);
        return Math.max(nums[0] * nums[1] * nums[nums.length-1], nums[nums.length-1] * nums[nums.length-2] * nums[nums.length-3]);
    }
}
